function checkDevTools(options) {
       const isFF = ~navigator.userAgent.indexOf("Firefox");
       let toTest = '';
       if (isFF) {
          toTest = /./;
          toTest.toString = function() {
            options.opened();
          }
       } else {
        toTest = new Image();
        toTest.__defineGetter__('id', function() {
            options.opened();
        });
       }
       setInterval(function() {
          options.offed();
          console.log(toTest);
          console.clear && console.clear();
       }, 1000);
    }

    checkDevTools({
      opened: function() {
        fuckyou();
      },
      offed: function() {
        //检测到没有打开开发者工具，不作处理
      }
    });

function fuckyou(){
window.close(); //关闭当前窗口(防抽)
window.location="about:blank"; //将当前窗口跳转置空白页
}